home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 2.1 KB | 70 lines | [TEXT/CWIE] |
- // Clipper.h
-
- #ifndef Clipper_h
- #define Clipper_h
-
- #ifndef RegionObject_h
- #include "RegionObject.h"
- #endif
-
- class Clipper
- {
- private:
- RegionObject saved;
- RegionObject current;
-
- void Clip() { SetClip( current ); }
-
- public:
- Clipper();
- Clipper( RgnHandle );
- Clipper( const Rect& );
- Clipper( const Clipper& );
-
- ~Clipper();
-
- void BeEmpty();
- void Restore();
-
- void operator=( const Rect& r );
- void operator=( RgnHandle r );
- void operator=( const Clipper& r );
-
- void operator&=( const Rect& r );
- void operator-=( const Rect& r );
-
- void operator&=( RgnHandle r );
- void operator-=( RgnHandle r );
-
- void Inset( int16 amount );
- void Inset( Point amount );
-
- Rectangle Bounds() const { return current.Bounds(); }
- operator const RegionObject&() const { return current; }
- operator RgnHandle() const { return current; }
- const RegionObject& Region() const { return current; }
-
- bool IsEmpty() const { return current.IsEmpty(); }
- bool Contains( Point p ) const { return current.Contains( p ); }
- bool Rectangular() const { return current.Rectangular(); }
-
- bool Intersects( const Rect& r ) const { return current.Intersects( r ); }
- bool Intersects( const RgnHandle r ) const { return current.Intersects( r ); }
-
- bool operator==( const Rect& r ) const { return current == r; }
- bool operator!=( const Rect& r ) const { return current != r; }
- bool operator<=( const Rect& r ) const { return current <= r; }
- bool operator>=( const Rect& r ) const { return current >= r; }
- bool operator<( const Rect& r ) const { return current < r; }
- bool operator>( const Rect& r ) const { return current > r; }
-
- bool operator==( RgnHandle r ) const { return current == r; }
- bool operator!=( RgnHandle r ) const { return current != r; }
- bool operator<=( RgnHandle r ) const { return current <= r; }
- bool operator>=( RgnHandle r ) const { return current >= r; }
- bool operator<( RgnHandle r ) const { return current < r; }
- bool operator>( RgnHandle r ) const { return current > r; }
- };
-
- #endif
-